namespace PDUConverter
{
    /// <summary>
    /// Data coding/Message class
    /// </summary>
    public class MessageCoding : DataCodingScheme
    {
        private bool bit3;

        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="dcs">The DCS byte to decode.</param>
        public MessageCoding(byte dcs) : base(dcs)
        {
            bit3 = (dcs & 8) > 0;
            DataCoding = ((dcs & 4) > 0) ? ((byte) 1) : ((byte) 0);
            MessageClass = (byte) (dcs & 3);
        }

        /// <summary>
        /// Gets the data coding.
        /// </summary>
        public new byte DataCoding { get; private set; }

        /// <summary>
        /// Gets the message class.
        /// </summary>
        public byte MessageClass { get; private set; }
    }
}